package com.neusoft.elmboot.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import com.neusoft.elmboot.po.Food;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface FoodMapper {

	@Select("select * from food where businessId=#{businessId} order by foodId")
	public List<Food> listFoodByBusinessId(Integer businessId);

	@Select("select * from food where foodId=#{foodId}")
	public Food getFoodById(Integer foodId);

	@Select("select quantity from food where foodId=#{foodId}")
	public int getQuantityByFoodId(int foodId);

	@Update("UPDATE food set quantity = #{quantity} where foodId=#{foodId}")
	public int setQuantityByFoodId(int foodId, int quantity);

	@Update("UPDATE food set foodPrice = #{foodPrice} where foodId=#{foodId}")
	public int setFoodPriceByFoodId(int foodId, Double foodPrice);
}
